#ifndef __STATE_MACHINE__
#define __STATE_MACHINE__

typedef enum
{
	STA1_KEY_UP 				= (uint8_t)1,
	STA2_KEY_DownShake  = (uint8_t)2,
	STA3_KEY_DOWN 			= (uint8_t)3,
	STA4_KEY_UpShake	  = (uint8_t)4,
}State_Machine_State_t;

typedef struct
{
	State_Machine_State_t State_Machine_State;
	uint16_t volatile State_Machine_Scan_Timer;
	uint16_t volatile State_Machine_DoubleClick_Timer;
	uint16_t volatile State_Machine_Press_Timer;
}State_Machine_t;

extern State_Machine_t State_Machine;
extern KEY_t KEY2;

static void KEY_Detect(void);
static void STA1_Machine(void);
static void STA2_Machine(void);
static void STA3_Machine(void);
static void STA4_Machine(void);
//void KEY2_RUN(void);

#endif